<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="UTF-8">
<title><?php echo C('SITE_TITLE');?></title>
<link href="/res/js/pikaday/css/pikaday.css"  rel="stylesheet" type="text/css" />
<link href="/res/css/index.css"  rel="stylesheet" type="text/css" />
<link href="/res/js/artDialog/ui-dialog.css"  rel="stylesheet" type="text/css" />
<script src="/res/js/jquery.js"></script>
<script src="/res/js/pikaday/moment.js"></script>
<script src="/res/js/pikaday/pikaday.js"></script>
<script src="/res/js/pikaday/plugins/pikaday.jquery.js"></script>
<script src="/res/js/artDialog/dialog-min.js"></script>
<script src="/res/js/template.js"></script>
<script src="/res/js/lib.js"></script>
<script src="/res/js/tool.js"></script>
</head>
<body>
<div id="header">
    <h1>广告联盟管理系统</h1>
    <ul>
        <li hide="4,5">提成：<span><?php echo getSiterServiceIncome(C('RUN_LOGIN_USER.uid'));?>元</span> ｜</li>
        <li id="viewHalfHourFlow" hide="3,4">30分结算：<span></span> ｜</li>
        <li>待审核：<a href="?m=Siter&status=0" hide="4">站长()</a> / 
        <a href="?m=Ader&status=0" hide="3">广告主()</a> /
        <a href="?m=Site&site_status=0" hide="4">网站()</a> ｜</li>
        <li><?php echo C('RUN_LOGIN_USER.user_name');?> 您好！
        <?php if(C('RUN_LOGIN_USER.last_login_time') == ''): ?>这是您第一次登陆
        <?php else: ?>
        上次登陆时间：<?php echo C('RUN_LOGIN_USER.last_login_time'); endif; ?>
        ｜
        </li>
        <!--<li><a href="#">短消息[10]</a></li>-->
        <li><a href="javascript:;" action="passwd">更改密码</a></li>
        <li><a href="javascript:;" action="logout">退出系统</a></li>
    </ul>
</div><!--/#header-->
<div id="main">
    <div id="nav">
        <div id="mainNav">
            <?php echo uiGetMainMenu();?>
        </div><!--/#mainNav-->
        <div id="subNav">
            <?php echo uiGetSubMenu();?>
        </div><!--/#subNav-->
    </div><!--/#nav-->
    <div id="spliter"></div><!--/#spliter-->
    <div id="zone">


<div id="zoneHeader">
    <h2>编辑站长信息</h2>
    <ul>
        <li><a href="?c=Siter" class="btn">返回</a></li>
    </ul>
</div><!--/#zoneHeader-->
<div id="zoneBody" class="noFooter">
    <div id="zoneBodyContent">
        <form action="?c=Siter&a=doSave" id="formEdit">
            <input type="hidden" name="id" />
            <table border="0" cellpadding="0" cellspacing="0" class="table3">
                <tr>
                    <th colspan="4">会员账户信息</th>
                </tr>
                <tr>
                    <td width="10%" align="right">ID：</td>
                    <td width="40%"><span name="id"></span></td>
                    <td width="10%" align="right">账户余额：</td>
                    <td width="40%"><span name="money"></span></td>
                </tr>
                <tr>
                    <td align="right">会员名称：</td>
                    <td><span name="name"></span></td>
                    <td align="right"></td>
                    <td></td>
                </tr>
                <tr>
                    <td align="right">会员性质：</td>
                    <td>
                        <label><input type="radio" name="type" value="1" /><span>网站主</span></label>
                        <label><input type="radio" name="type" value="2" /><span>广告主</span></label>
                    </td>
                    <td align="right"></td>
                    <td></td>
                </tr>
                <tr>
                    <td align="right">会员状态：</td>
                    <td>
                        <select name="status">
                            <?php $_result=C('USER_STATUS');if(is_array($_result)): $i = 0; $__LIST__ = $_result;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><option value="<?php echo ($key); ?>"><?php echo ($vo); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
                        </select>
                    </td>
                    <td align="right">QQ：</td>
                    <td> <input name="qq" type="text" /> </td>
                </tr>
                <tr>
                    <td align="right">客服专员：</td>
                    <td>
                        <select name="service_id">
                            <option value="0">请选择客服</option>
                            <?php $_result=getAllSiterServiceList();if(is_array($_result)): $i = 0; $__LIST__ = $_result;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><option value="<?php echo ($vo['id']); ?>"><?php echo ($vo['contact']); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
                        </select>
                    </td>
                    <td align="right">E-mail：</td>
                    <td><input name="email" type="text" /></td>
                </tr>
                <tr>
                    <td align="right">联系电话：</td>
                    <td><input name="tel" type="text" /></td>
                    <td align="right">结算方式：</td>
                    <td><label>
                      <input type="radio" name="clearing" value="day" />
                      <span>日结</span></label>
                      <label>
                        <input type="radio" name="clearing" value="week" />
                        <span>周结</span></label>
                      <label>
                        <input type="radio" name="clearing" value="month" />
                    <span>月结</span></label></td>
                </tr>
                <tr>
                    <td align="right">提示问题：</td>
                    <td><input name="question" type="text" /></td>
                    <td align="right">回答问题：</td>
                    <td><input name="answer" type="text" /></td>
                </tr>
                <tr>
                    <td align="right">会员密码：</td>
                    <td>
                        <input name="password" type="text" />
                        <p>不修改密码请留空</p>
                    </td>
                    <td align="right">联系人：</td>
                    <td><input name="contact" type="text" /></td>
                </tr>
                <tr>
                  <td align="right">投放域名限制：</td>
                  <td>
                      <label><input type="radio" name="limit_ad_domain" value="1" /><span>只允许在已审核域名投放</span></label>
                      <label><input type="radio" name="limit_ad_domain" value="0" /><span>不限制投放域名</span></label>
                  </td>
                  <td align="right"></td>
                  <td></td>
                </tr>
                <tr>
                  <td align="right">&nbsp;</td>
                  <td>&nbsp;</td>
                  <td align="right"></td>
                  <td></td>
                </tr>
                <tr>
                    <th colspan="3">银行信息</th>
                    <th>会员扣量</th>
                </tr>
                <tr>
                    <td align="right">收款人：</td>
                    <td><input name="accountname" type="text" /></td>
                    <td colspan="2" rowspan="5" align="right">
<style>
#siter-deduct-contrainer {}
#siter-deduct-contrainer dl { overflow:auto; margin:5px 0; }
#siter-deduct-contrainer dt { float:left; width:10%; }
#siter-deduct-contrainer dt span { display:inline-block; padding:0 5px;}
#siter-deduct-contrainer dd { float:left; width:90%; }
#siter-deduct-contrainer ul { overflow:auto; }
#siter-deduct-contrainer li { float:left; width:25%; text-align:left; }
</style>
                        <div id="siter-deduct-contrainer">
                            <dl>
                                <dt>&nbsp;</dt>
                                <dd>
                                    <ul>
                                        <?php $planType = C('PLAN_TYPES'); ?>
                                        <?php if(is_array($planType)): foreach($planType as $key=>$v): ?><li><?php echo ($v); ?></li><?php endforeach; endif; ?>
                                    </ul>
                                </dd>
                            </dl>

                            <?php $planDevice = C('PLAN_DEVICES'); ?>
                            <?php if(is_array($planDevice)): foreach($planDevice as $deviceIndex=>$deviceName): ?><dl>
                                <dt><span><?php echo ($deviceName); ?></span></dt>
                                <dd>
                                    <ul>
                                        <?php if(is_array($planType)): foreach($planType as $k=>$v): ?><li><input type="text" name="deduct_<?php echo ($k); ?>_<?php echo ($deviceIndex); ?>"></li><?php endforeach; endif; ?>
                                    </ul>
                                </dd>
                            </dl><?php endforeach; endif; ?>
                        </div>

                    </td>
                </tr>
                <tr>
                    <td align="right">银行名称：</td>
                    <td>
                        <select name="bank" id="bank">
                            <?php $_result=C('BANK');if(is_array($_result)): $i = 0; $__LIST__ = $_result;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><option value="<?php echo (strtolower($key)); ?>"><?php echo ($vo); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td align="right">银行账号：</td>
                    <td><input name="bankacc" type="text" /></td>
                </tr>
                <tr>
                    <td align="right">开户行名称：</td>
                    <td><input name="bankname" type="text" /></td>
                </tr>
                <tr>
                    <td align="right">&nbsp;</td>
                    <td>&nbsp;</td>
                </tr>
                <tr>
                    <th colspan="4">其他信息</th>
                </tr>
                <tr>
                    <td align="right">注册IP：</td>
                    <td><span name="create_ip"></span><span name="create_ip_addr" style="display:block"></span></td>
                    <td align="right">注册时间：</td>
                    <td><span name="create_time"></span></td>
                </tr>
                <tr>
                    <td align="right">最后登录IP：</td>
                    <td><span name="last_login_ip"></span><span name="last_login_ip_addr" style="display:block"></span></td>
                    <td align="right">最后登录时间：</td>
                    <td><span name="last_login_time"></span></td>
                </tr>
            </table>

            <ul class="btnList">
                <li><button type="submit" class="btnFormEditSave">保存</button></li>
                <li><a href="?c=Siter" class="btn">返回</a></li>
            </ul>
        </form>
    </div><!--/#zoneBodyContent-->
</div><!--/#zoneBody-->
<script>
$(function(){
    <?php if(!empty($record)): ?>var record = <?php echo (json_encode($record)); ?>;
    record.money = <?php echo getTotalMoney($record['daymoney'], $record['weekmoney'], $record['monthmoney']);?>;
    record.password = '';
    record.create_ip_addr = "<?php echo get_location_ip($record['reg_ip']);?>";
    <?php if(!empty($record["last_login_ip"])): ?>record.last_login_ip_addr = "<?php echo get_location_ip($record['last_login_ip']);?>";<?php endif; ?>

    new Form($('#formEdit'), new Model(record));<?php endif; ?>
})
</script>
    </div><!--/#zone-->
</div><!--/#main-->
<div class="hide">
<div id="t-recharge-form">
<style>
.recharge-form {}
.recharge-form dd    { overflow:auto; }
.recharge-form label { float:left; }
.recharge-form label span { display:inline-block; color:#333; }
</style>
<dl class="dl2Col recharge-form">
    <dt>会员名称：</dt>
    <dd><input type="hidden" name="id"><input type="text" name="user_name" class="fW50"><span></span></dd>
    <dt g="money_type">对象：</dt>
    <dd g="money_type">
        <label><input type="radio" name="money_type" value="1"><span>日余额</span></label>
        <label><input type="radio" name="money_type" value="2"><span>周余额</span></label>
        <label><input type="radio" name="money_type" value="3"><span>月余额</span></label>
    </dd>
    <dt>方式：</dt>
    <dd>
        <label g="money_add"><input type="radio" name="type" checked="checked" value="1"><span>增加</span></label>
        <label g="money_deduct"><input type="radio" name="type" value="2"><span>扣除</span></label>
        <label g="money_pre"><input type="radio" name="type" value="3"><span>预充</span></label>
    </dd>
    <dt>金额：</dt>
    <dd><input type="text" name="money" class="fW30" /> 元</dd>
    <dt>备注：</dt>
    <dd><textarea name="comment" style="width:80%;height:50px;"></textarea></dd>
</dl>
</div>

<div id="tRechargeEditForm">
    <dl class="dl2Col">
        <dt>会员名称：</dt>
        <dd><input type="text" name="user_name" class="fW50" /><span></span></dd>
        <dt t="moneyType" class="hide">对象：</dt>
        <dd t="moneyType" class="hide">
            <label><input type="radio" name="r_money_type" value="day" checked="checked" /><span>日余额</span></label>
            <label><input type="radio" name="r_money_type" value="week" /><span>周余额</span></label>
            <label><input type="radio" name="r_money_type" value="month" /><span>月余额</span></label>
        </dd>
        <dt>方式：</dt>
        <dd>
            <label><input type="radio" name="r_status" checked="checked" value="3" /><span>增加</span></label>
            <label><input type="radio" name="r_status" value="4" /><span>扣除</span></label>
            <label><input type="radio" name="r_status" value="5" /><span>预充</span></label>
        </dd>
        <dt>金额：</dt>
        <dd><input type="text" name="r_money" class="fW30" /> 元</dd>
        <dt>备注：</dt>
        <dd><textarea name="r_comment" style="width:80%"></textarea></dd>
    </dl>
</div><!--/#tRechargeEditForm-->

<style type="text/css">
</style>
<div id="tPasswd">
    <dl class="dl2Col">
        <dt>旧密码：</dt>
        <dd><input name="old_passwd" type="password" class="fW150p" /></dd>
        <dt>新密码：</dt>
        <dd><input name="new_passwd" type="password" class="fW150p" /></dd>
        <dt>确认新密码：</dt>
        <dd><input name="new_passwd_2" type="password" class="fW150p" /></dd>
    </dl>
</div><!--/#tPasswd-->

<div id="tUserAddForm" style="width:550px;height:280px;">
    <input type="hidden" name="uid" />
    <dl class="dl2Col">
        <dt>登陆名称：</dt>
        <dd><input type="text" name="user_name" class="fW150p" /><span class="formTips">登陆名称长度最少<?php echo C('USER_NAME_MIN_LEN');?>个字符，最多<?php echo C('USER_NAME_MAX_LEN');?>个字符</span></dd>
        <dt>真实姓名：</dt>
        <dd><input type="text" name="contact" class="fW150p" /></dd>
        <dt>密码：</dt>
        <dd><input type="text" name="password" class="fW150p" /><span class="formTips">密码长度最少<?php echo C('PASSWD_MIN_LEN');?>个字符，最多<?php echo C('PASSWD_MAX_LEN');?>个字符</span></dd>
        <dt>QQ：</dt>
        <dd><input type="text" name="qq" class="fW150p" /></dd>
        <dt g="income_scale">提成比例：</dt>
        <dd g="income_scale"><input type="text" name="recommend_income_scale" class="fW150p" />% <span class="formTips">设置客服的提成比例</span></dd>
        <dt>会员类型：</dt>
        <dd>
            <label><input type="radio" name="type" value="3" checked="checked" /><span>站长客服</span></label>
            <label><input type="radio" name="type" value="4" /><span>广告主客服</span></label>
            <label><input type="radio" name="type" value="5" /><span>管理员</span></label>
        </dd>
        <dt>登陆状态：</dt>
        <dd>
            <label><input type="radio" name="status" value="2" checked="checked" /><span>允许登陆</span></label>
            <label><input type="radio" name="status" value="0" /><span>禁止登陆</span></label>
        </dd>
    </dl>
</div><!--/#tUserAddForm-->

<div id="tUserModifyForm" style="width:550px;height:280px;">
    <input type="hidden" name="uid" />
    <dl class="dl2Col">
        <dt>登陆名称：</dt>
        <dd><span name="user_name"></span></dd>
        <dt>真实姓名：</dt>
        <dd><input type="text" name="contact" class="fW150p" /></dd>
        <dt>密码：</dt>
        <dd><input type="text" name="password" class="fW150p" /><span class="formTips">如果不需修密码，请留空此处</span></dd>
        <dt>QQ：</dt>
        <dd><input type="text" name="qq" class="fW150p" /></dd>
        <dt g="income_scale">提成比例：</dt>
        <dd g="income_scale"><input type="text" name="recommend_income_scale" class="fW150p" />% <span class="formTips">设置客服的提成比例</span></dd>
        <dt>会员类型：</dt>
        <dd>
            <label><input type="radio" name="type" value="3" disabled="disabled" /><span>站长客服</span></label>
            <label><input type="radio" name="type" value="4" disabled="disabled" /><span>广告主客服</span></label>
            <label><input type="radio" name="type" value="5" disabled="disabled" /><span>管理员</span></label>
        </dd>
        <dt>登陆状态：</dt>
        <dd>
            <label><input type="radio" name="status" value="2" checked="checked" /><span>允许登陆</span></label>
            <label><input type="radio" name="status" value="0" /><span>禁止登陆</span></label>
        </dd>
    </dl>
</div><!--/#tUserModifyForm-->

</div><!--/.hide-->

<script>
function sendMessage(toUser) {
    toUser = toUser || '';
    Message.edit.add(toUser);
}

<?php $tmpLocalConf = include(APP_PATH . '../Public/Conf/local.php'); $tmpStatsWarnConf = array(); $tmpStatsWarnConfPre = 'stats_warn_conf_'; $tmpStatsWarnConfPreLen = strlen($tmpStatsWarnConfPre); foreach($tmpLocalConf as $k => $v) { $tmpKey = strtolower($k); if(substr($tmpKey, 0, $tmpStatsWarnConfPreLen) == $tmpStatsWarnConfPre) { if(substr($tmpKey, -3) == '_op') { continue; } $newKey = str_replace($tmpStatsWarnConfPre, '', $tmpKey); if(is_null($v) || strlen($v) < 1) { continue; } $tmpStatsWarnConf[$newKey] = array($tmpLocalConf[$k . '_op'], (float)$v); } } ?>

var statsWarnConf = <?php echo json_encode($tmpStatsWarnConf);?>;

function checkStatsWarn() {
    var groupKeyPre = 'g_';

    $.each(statsWarnConf, function(k, v) {
        var key = groupKeyPre + k,
            $o = $('[g=' + key + ']');

        $o.each(function(k2, v2){
            var $o2 = $(v2),
                code = $o2.html() + v[0] + v[1],
                result = eval(code);

                console.log(code + '=' + result);

            if(result) {
                var $td = $o2.parents('td'),
                    title = $td.attr('title') + v[0] + v[1] + '%';

                $o2.attr('title', title);
                $td.css('background-color', 'red');
            }
        }) 
    })
}

$(function(){
    var Config = {
        SITE_STATUS        : <?php echo (json_encode(C("SITE_STATUS"))); ?>,
        REDIRECT_APP       : '<?php echo C('REDIRECT_APP');?>',
        LOGIN_URL          : '<?php echo C('LOGIN_URL');?>',
        LOGOUT_TO_URL      : '<?php echo C('LOGOUT_TO_URL');?>',
        USER_NAME_MIN_LEN  : <?php echo C('USER_NAME_MIN_LEN');?>,
        USER_NAME_MAX_LEN  : <?php echo C('USER_NAME_MAX_LEN');?>,
        PASSWD_MIN_LEN     : <?php echo C('PASSWD_MIN_LEN');?>,
        PASSWD_MAX_LEN     : <?php echo C('PASSWD_MAX_LEN');?>,
        CURRENT_USER_TYPE  : <?php echo C('RUN_LOGIN_USER.type');?>,             //当前登陆会员的类型
        AD_TYPE            : <?php echo json_encode(C('AD_TYPE'));?>,
        AD_STATUS          : <?php echo json_encode(C('AD_STATUS'));?>,
        SITER_SERVICE_TYPE : 3,                                       //站长客服编号
        ADMIN_USER_TYPE    : 5                                        //管理员会员类型编号
    };

    <?php if(!empty($searchJson)): ?>Conf.set('searchDao', <?php echo ($searchJson); ?>);   //查询条件<?php endif; ?>

    Conf.set(Config);

    //Index.init();
    //User.init();
})
</script>
<script type="text/javascript" src="/res/admin/js/init.js"></script>
<script type="text/javascript" src="/res/admin/js/app.js"></script>

</body>
</html>